import Vue from "vue";
import VueRouter from "vue-router";
import Container from "../views/main/Container";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Home",
    redirect: "/home",
    component: Container,
    meta: { title: "主页" },
    children: [
      {
        path: "/home",
        name: "Home",
        component: () =>
          import(/* webpackChunkName: "about" */ "../views/home/Home.vue"),
        meta: { title: "日程管理" },
      },
    ],
  },{
    path: "/admin",
    name: "后台管理",
    redirect: "/admin/user-manager",
    component: Container,
    meta: { title: "后台管理" },
    children: [
      {
        path: "/admin/user-manager",
        name: "用户管理",
        component: () => import("@view/admin/UserManager"),
        meta: { title: "用户管理" },
      }, {
        path: "/admin/company-manager",
        name: "部门管理",
        component: () => import("@view/admin/CompanyManager"),
        meta: { title: "部门管理" },
      }, {
        path: "/admin/form-edit-test",
        name: "表单测试",
        component: () => import("../views/test/FormEditText"),
        meta: { title: "表单测试" },
      }, {
        path: "/admin/gzt",
        name: "工作台",
        component: ()=>import('../views/test/gzt.vue'),
        meta: { title: "工作台", desktop:true },
      }, {
        path: "/admin/grid-test",
        name: "表格测试",
        component: ()=>import('../views/test/GridTest.vue'),
        meta: { title: "表格测试" },
      }, {
        path: "/admin/base-grid-test",
        name: "表格测试1",
        component: ()=>import('../views/test/BaseGridTest.vue'),
        meta: { title: "表格测试" },
      },
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
